import MFooter from './MFooter/MFooter.vue'
import MHeader from './MHeader/MHeader.vue'
import MLoading from './MLoading/MLoading.vue'
import MHeaderTitle from './MHeaderTitle/MHeaderTitle.vue'
import MPullRefresh from './MPullRefresh/MPullRefresh.vue'

export const components = {
  MFooter,
  MHeader,
  MLoading,
  MHeaderTitle,
  MPullRefresh
}
// 定义插件安装方法
const install:any = function (Vue: any) {
   if (!Vue || install.installed) {
      return
   }
   const componentsNames = Object.keys(components)
   componentsNames.forEach(name => {
      const component = components[name]
      component.name && Vue.component(component.name, component)
   })
}
if (typeof window !== 'undefined' && window.Vue) {
   install(window.Vue)
}

export {
   MFooter,
   MHeader,
   MLoading,
  MHeaderTitle,
   MPullRefresh
  //  MVerify
}

export default {
   install
}